package guda.stark.biz.form;

import guda.stark.dal.dataobject.ResourceDO;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;


public class ResourceForm {

    @NotNull(message = "不能为空")
    @Size(min=1,max=10,message = "长度在0到10个字符之间")
    private String resourceCat;
    @NotNull(message = "不能为空")
    @Size(min=1,max=20,message = "长度在0到20个字符之间")
    private String resourceName;
    @NotNull(message = "不能为空")
    @Size(min=1,max=200,message = "长度在0到200个字符之间")
    private String resourceUrl;

    public String getResourceCat() {
        return resourceCat;
    }

    public void setResourceCat(String resourceCat) {
        this.resourceCat = resourceCat;
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }

    public ResourceDO toDO() {
        ResourceDO resourceDO = new ResourceDO();
        resourceDO.setResourceCat(resourceCat);
        resourceDO.setResourceName(resourceName);
        resourceDO.setResourceUrl(resourceUrl);
        return resourceDO;
    }

}
